import request from '@/utils/request'

// 获得出差申请详情
export function getTravelInfoForApproval(insCode) {
  return request({
    url: `/approve/travel/${insCode}`,
    method: 'get',
    params: insCode
  })
}

// 审批通过出差申请
export function approveTravel(travelId, data) {
  return request({
    url: `/approve/travel/${travelId}/approvaled`,
    method: 'put',
    data
  })
}

// 审批驳回出差申请
export function approveTravelDisagree(travelId, data) {
  return request({
    url: `/approve/travel/${travelId}/disagree`,
    method: 'put',
    data
  })
}

// 获得考勤申诉详情
export function getAppealInfoForApproval(insCode) {
  return request({
    url: `/approve/appeal/${insCode}`,
    method: 'get',
    params: insCode
  })
}

// 审批通过考勤申诉
export function approveAppeal(explainId, data) {
  return request({
    url: `/approve/appeal/${explainId}/approvaled`,
    method: 'put',
    data
  })
}

// 审批驳回考勤申诉
export function approveAppealDisagree(explainId, data) {
  return request({
    url: `/approve/appeal/${explainId}/disagree`,
    method: 'put',
    data
  })
}

// 获得请假单详情
export function getLeaveInfoForApproval(insCode) {
  return request({
    url: `/approve/leave/${insCode}`,
    method: 'get',
    params: insCode
  })
}

// 审批通过请假单申请
export function approveLeave(leaveId, data) {
  return request({
    url: `/approve/leave/${leaveId}/approvaled`,
    method: 'put',
    data
  })
}

// 审批驳回请假单申请
export function approveLeaveDisagree(leaveId, data) {
  return request({
    url: `/approve/leave/${leaveId}/disagree`,
    method: 'put',
    data
  })
}

// 查询任务监控（待办审批记录)
export function getTaskMonitorList(processInstID, data) {
  return request({
    url: `/approve/historys/${processInstID}`,
    method: 'get',
    params: { processInstID, data }
  })
}

// export function appealAdd(data) {
//   return request({
//     url: '/appeal',
//     method: 'post',
//     data
//   })
// }

// export function appealDelete(id) {
//   return request({
//     url: `/appeal/${id}`,
//     method: 'delete'
//   })
// }

// export function appealUpdate(id, data) {
//   return request({
//     url: `/appeal/${id}`,
//     method: 'put',
//     data
//   })
// }

// export function appealSubmit(id, data) {
//   return request({
//     url: `/appeal/${id}/submit`,
//     method: 'put',
//     data
//   })
// }
